Skip to content

Centralize codegen path configuration#1069

Merged
louis-pre merged 2 commits into
mainfrom
centralize-codegen-paths
Apr 20, 2026
Merged

Centralize codegen path configuration#1069
louis-pre merged 2 commits into
mainfrom
centralize-codegen-paths

Conversation

@louis-pre

@louis-pre louis-pre commented Apr 20, 2026

Copy link
Copy Markdown
Member

Summary

Add codegen/lib/config.ts as a single source of truth for all path-related constants in the codegen. Changing the output directory or URL prefix now only requires editing one file.

Config values

Constant Value Used for
apiReferenceRoot 'docs/api-reference' Site section root from repo root
guidesRoot 'docs/guides' Guides site section root
apiReferenceUrlPrefix '/api' Published URL prefix for the site section
baseUrl 'https://docs.seam.co/latest/' Docs site base URL
siteUrlPrefix '/latest' URL prefix to strip when resolving paths
apiReferenceSummaryPath 'docs/api-reference/SUMMARY.md' Derived SUMMARY.md location

Other changes

  • Metalsmith destination changed from ../docs to ../ (repo root) so file keys match full paths from repo root
  • Source directory renamed from codegen/docs/ to codegen/source/ to avoid confusion with the output docs/ directory
  • All codegen files import from config instead of defining their own constants

🤖 Generated with Claude Code

@louis-pre louis-pre requested a review from a team as a code owner April 20, 2026 23:24
@louis-pre louis-pre force-pushed the centralize-codegen-paths branch 2 times, most recently from eb187e3 to 4be7a8b Compare April 20, 2026 23:37
Add codegen/lib/config.ts as single source of truth for all paths:
- apiReferenceRoot: site section root from repo root ('docs/api-reference')
- guidesRoot: guides site section root ('docs/guides')
- apiUrlPrefix: published URL prefix ('/api')
- baseUrl, siteUrlPrefix: docs site URL constants

Change Metalsmith destination from '../docs' to '../' (repo root) so
file keys match the full path from repo root (docs/api-reference/...).
Rename source directory from codegen/docs/ to codegen/source/ to
avoid confusion with the output docs/ directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@louis-pre louis-pre force-pushed the centralize-codegen-paths branch from 1124dd2 to c929c05 Compare April 20, 2026 23:42
@louis-pre louis-pre merged commit 566104f into main Apr 20, 2026
9 checks passed
@louis-pre louis-pre deleted the centralize-codegen-paths branch April 20, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants